package com.litq.education.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.litq.education.bean.GroupTable;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * GroupMapper
 *
 * @author litq
 * @version v1.0
 * @since 2019/8/19 1:31
 */
@Mapper
public interface GroupMapper extends BaseMapper<GroupTable>  {

    /**
     * @param page 页码
     * @param id
     * @Method 页面查询活动所有信息
     * @Author Litq
     * @Version 1.0
     * @Description 页面查询活动所有信息
     * @since 2019/8/16
     */
    @Select(" SELECT * from `group_table` ")
    List<Map<String, Object>> dyGetGroupList(Page<Map<String, Object>> page, Integer id);

    @Select("select count(*) from `group_table` ")
    int count();

    @Select(" SELECT * from `group_table` where group_name = #{groupName} ")
    List<Map<String, Object>> dyGetGroupListByName(Page<Map<String, Object>> page, Integer id,String groupName);

    @Delete("DELETE FROM `customer_table` WHERE group_id = #{group_id}")
    int deleteCustomerByid(int id);



}
